package test01;

import java.util.Random;

public class demo12 {
    public static void main(String[] args) {
        int sum1=0;     //奇数位的和
        int sum2=0;     //偶数位的和
        int num[]=new int[12];      //存储每个数
        for(int i=1;i<=12;i++){
            int random=(int)(Math.random()*10);
            num[i-1]=random;
            if(i%2==0){
                sum2+=random;
            }else{
                sum1+=random;
            }
        }
        int result=10-(sum1+sum2*3)%10;
        System.out.print("输入：");
        for(int i=0;i<12;i++){
            System.out.print(num[i]);
        }
        System.out.println();
        System.out.print("输出：");
        for(int i=0;i<12;i++){
            System.out.print(num[i]);
        }
        System.out.println(result);
    }
}
